﻿ 

 

// ******************************************************
// 这段代码是自动生成的
// 修改里面的代码，下次生成的时候会被覆盖
// ******************************************************
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.ServiceModel;
using System.Threading.Tasks;
using Sharp.Application;
using Sharp.DataTransferObject;
using System.ServiceModel.Activation;
using Sharp.Infrastructure.Search;
using Sharp.DataTransferObject.Workflow;
using Sharp.ServiceContracts;
using Sharp.Infrastructure;
using Sharp.Infrastructure.Interfaces;
using Sharp.Infrastructure.IoC;
namespace Sharp.Services
{
	[DebuggerStepThrough]
	[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
	[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple, UseSynchronizationContext = false)]
	public class WorkflowService : IWorkflowService
	{
		private readonly IWorkflowService _impl = ServiceLocator.Instance.GetService<IWorkflowService>();
		public Result SaveProcess(ProcessDTO model)
		{
			try
			{
				return _impl.SaveProcess(model);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public Int32 CreateProcess(ProcessDTO entity)
		{
			try
			{
				return _impl.CreateProcess(entity);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public void DeleteProcess(String processGUID, String version)
		{
			try
			{
				 _impl.DeleteProcess(processGUID, version);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public Result DeleteProcessById(Int32[] ids)
		{
			try
			{
				return _impl.DeleteProcessById(ids);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public ProcessDTO GetProcessByVersion(String processGUID, String version)
		{
			try
			{
				return _impl.GetProcessByVersion(processGUID, version);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public IList<Sharp.DataTransferObject.Workflow.ProcessDTO> GetProcessListSimple()
		{
			try
			{
				return _impl.GetProcessListSimple();
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public ProcessDTO GetProcess(String processGUID)
		{
			try
			{
				return _impl.GetProcess(processGUID);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public void SaveProcessFile(ProcessFileDTO entity)
		{
			try
			{
				 _impl.SaveProcessFile(entity);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public PagedResult<Sharp.DataTransferObject.Workflow.ProcessDTO> GetProcessPaged(PagingFeature pf)
		{
			try
			{
				return _impl.GetProcessPaged(pf);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public IList<Sharp.DataTransferObject.Workflow.ActivityInstanceDTO> GetRunningActivityInstance(String appInstanceID, String processGUID)
		{
			try
			{
				return _impl.GetRunningActivityInstance(appInstanceID, processGUID);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public ProcessFileDTO GetProcessFile(String processGUID, String version)
		{
			try
			{
				return _impl.GetProcessFile(processGUID, version);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public ProcessFileDTO GetProcessFileByID(Int32 id)
		{
			try
			{
				return _impl.GetProcessFileByID(id);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public ProcessDTO GetProcessInfo(Int32 id)
		{
			try
			{
				return _impl.GetProcessInfo(id);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public PagedResult<Sharp.DataTransferObject.Workflow.TaskDTO> GetReadyTasksPaged(PagingFeature pf)
		{
			try
			{
				return _impl.GetReadyTasksPaged(pf);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public PagedResult<Sharp.DataTransferObject.Workflow.TaskDTO> GetCompletedTasksPaged(PagingFeature pf)
		{
			try
			{
				return _impl.GetCompletedTasksPaged(pf);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
	}
}